import {Spin} from 'antd'
import React, { Suspense } from 'react'


const lazyLoad = (Comp:React.LazyExoticComponent<any>):React.ReactNode=>{
    return (
        <Suspense fallback={<Spin
          size='large'
          style={{
            display:'flex',
            justifyContent:'center',
            alignItems:'center',
            height:'100vh'
          }}
        ></Spin>}>
            <Comp/>
        </Suspense>
    )
}

export default lazyLoad